<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>background-clip</title>
	<style type="text/css">
		* {
			margin: 0;
			padding: 0;
			border:none;
		}
		div {
			width: 800px;
			height: 400px;
			padding: 50px;/*内边距50像素*/
			border: 50px solid transparent;/*边框50像素，实线（透明）*/
			background: url('bg1.jpg') no-repeat center center;/*引入一个背景图片，不重复，居中*/
			background-clip: border-box;
			background-clip: padding-box;
			background-clip: content-box;
		}
		span.div_border {
			position: absolute;
			top: 0;
			left: 0;
			width: 800px;
			height: 400px;
			padding: 50px;
			border: 50px solid rgba(255, 0, 0, .25);
		}
		span.div_padding {
			position: absolute;
			top: 50px;
			left: 50px;
			width: 800px;
			height: 400px;
			border: 50px solid rgba(255, 255, 0, .25);
		}
	</style>
</head>
<body>
<div></div>
<span class="div_border"></span>
<span class="div_padding"></span>
</body>
</html>